const util = {
  state: {
    tableY: '100%'
  },
  mutations: {
    setTableY (state, value) {
      state.tableY = value
    }
  },
  actions: {
    tableScrollY ({ commit }) {
      const el = document.querySelector('#aTable')
      let top = (el && el.getBoundingClientRect().top) || 'auto'
      if (el && top >= 110) {
        top = window.innerHeight - el.getBoundingClientRect().top
      }
      // eslint-disable-next-line no-debugger

      commit('setTableY', top)
    },
    
  }
}

export default util
